<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
 
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.Controller"%>	
<%@ page import="org.limp.mine.DateTrimmer"%>
<% 
    String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[])request.getAttribute("result");	
	Label label = (Label)result[1];
	Controller controller = (Controller)result[2];	
	String pageNO = (String)result[3];
	List resultList = (List) result[0];
	
	String wjfsr_name = (String)request.getAttribute("wjfsr_name");
	String wj_name = (String)request.getAttribute("wj_name");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>文件接收列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<style>
h1 {
	font-family: Arial, sans-serif;
	font-size: 15px;
	color: #369;
	padding-bottom: 4px;
	border-bottom: 1px solid #999;
}
</style>
<script language="javascript">
  function handleQuery(){
      document.form1.action = context + "/app/wjcs.do?method=list4query_js";
      document.form1.submit();
  }
  
  function init() {
	if (parent && parent.resizeFrame) {
		parent
				.resizeFrame(document.getElementsByTagName("body")[0].scrollHeight
						+ 50);
	}
  } 
  
  function viewFile(aid, id){
      var url = context + '/app/wjcs.do?method=read&id=' + id;
		  Ext.Ajax.request({
				// 请求地址
				url : url,
				scriptTag : true,
				// 成功时回调
				success : function(response, options) {
					var json = response.responseText;
					var o = Ext.util.JSON.decode(json);
                    
                    viewAnnex(aid);
				},
				failure : function(response, options) {
					alert('查阅文件出现异常!');
				}
			});
  }
   
  function handleReresh(){
      window.location.href = context + "/app/wjcs.do?method=list4query_js&pageNO=<%=pageNO%>";
  }
</script>
<script src="<%=context%>/resources/common/js/common.js"></script>
<body onload="inithelper();init();">
<form name="form1" method="post" action="">
<input type="hidden" name="pageNO" value="<%=pageNO%>">
<br/>
<div style="width:100%;"><h1>&nbsp;&nbsp;文件接收列表</h1></div>
<table class="tab4list" border="0" width="95%" align="center" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="3" class="td0">
    发送人姓名：<input type="text" class="box3" name="wjfsr_name" value="<%=wjfsr_name%>">
       文件名称：<input type="text" class="box3" name="wj_name" value="<%=wj_name%>">
    <img src="/oa/system/workflow/images/query.png" title="查询" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleQuery();"/>查询   
    </td>
  </tr>
  <tr class="tr1"> 
    
    <td class="td1" width="70%">&nbsp;文件名称</td>
    <td class="td1" width="15%" align="center">&nbsp;文件发送人</td>
    <td class="td1" width="15%" align="center">&nbsp;文件接收时间</td>
    
  </tr>
  <% 
    if(resultList!=null&&!resultList.isEmpty()){
    
       for(int i=0;i<resultList.size();i++){
	       Map info = (Map)resultList.get(i);
	       String number = (String)info.get("PAGINATION_NUMBER");
	       String ANNEX_NAME = info.get("ANNEX_NAME").toString();
	       
	       String WJJSR_NAME = info.get("USERNAME").toString();
	        
           String RECEIVE_TIME = info.get("SEND_TIME").toString();
           String WJJS_STATUS = "";
           String id = info.get("ID").toString();
           String fj_id = info.get("XSYSTEM_ANNEX_ID").toString();
           String mytime="";
           //String mytime = DateTrimmer.format2YYYYMMdd(SEND_TIME);
           if(!"".equals(RECEIVE_TIME)){
        	   mytime = DateTrimmer.formatDateForVarchar(RECEIVE_TIME);
        	   
           }
           
          
  %> 
  <tr> 
    <td height="27">&nbsp;<a href="javascript:void(0);" title="点击查阅或下载文件" onclick="javascript:viewFile('<%=fj_id%>', '<%=id%>');"><%=ANNEX_NAME%></a></td>
    <td align="center">&nbsp;<%=WJJSR_NAME%></td>
    <td align="center">&nbsp;<%=DateTrimmer.getYMDHM_LBL(RECEIVE_TIME)%></td>
   
  </tr>
  <%
        }
     }
  %>
</table> 
<table width="95%" class="tab-noborder" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
   <td>
    <%=label.displayLabel()%>
   </td>
   <td align="right">
        <%=label.startLabel()%>
        <%=label.previousLabel()%>
        <%=label.nextLabel()%>
        <%=label.endLabel()%>
        <%=controller.getController().toString()%>
    </td>
  </tr>
</table>  
<%=controller.getControlScript(true)%> 
</form>
</body>
</html>	